Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(176)

Issue 371563005: Extensions: DCHECK that all app pages are blessed before use. (Closed)

Created:
6 years, 5 months ago by Matt Giuca
Modified:
3 years, 3 months ago
CC:
chromium-reviews, chromium-apps-reviews_chromium.org, extensions-reviews_chromium.org, chrome-apps-syd-reviews_chromium.org, benwells
Project:
chromium
Visibility:
Public.

Description

Extensions: DCHECK that all app pages are blessed before use. This helps catch bugs where an app page is rendered but has not been activated, which means it will not be given the correct context (styling and APIs). This would catch bugs such as one previously committed with launcher pages (see http://crbug.com/391137). BUG=391137

Patch Set 1 #

Total comments: 2

Patch Set 2 : Address kalman's comments. #

Total comments: 3

Patch Set 3 : Rebase. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+12 lines, -3 lines) Patch
M extensions/renderer/dispatcher.cc View 1 2 2 chunks +12 lines, -3 lines 0 comments Download

Messages

Total messages: 13 (0 generated)
Matt Giuca
Hi Ben, I'm splitting this out of https://codereview.chromium.org/365013003/ (there is a small existing discussion with ...
6 years, 5 months ago (2014-07-04 04:11:41 UTC) #1
not at google - send to devlin
lgtm https://codereview.chromium.org/371563005/diff/1/extensions/renderer/dispatcher.cc File extensions/renderer/dispatcher.cc (right): https://codereview.chromium.org/371563005/diff/1/extensions/renderer/dispatcher.cc#newcode268 extensions/renderer/dispatcher.cc:268: DCHECK(IsExtensionActive(extension_id)); Good idea. A slightly stronger check would ...
6 years, 5 months ago (2014-07-07 14:45:55 UTC) #2
Matt Giuca
Thanks. Note: I can't submit this until https://codereview.chromium.org/365013003/ is submitted (because it would fail this ...
6 years, 5 months ago (2014-07-10 08:04:56 UTC) #3
Matt Giuca
The CQ bit was checked by mgiuca@chromium.org
6 years, 5 months ago (2014-07-11 03:54:04 UTC) #4
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/mgiuca@chromium.org/371563005/20001
6 years, 5 months ago (2014-07-11 03:55:32 UTC) #5
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). The failing builders are: android_dbg_triggered_tests on tryserver.chromium ...
6 years, 5 months ago (2014-07-11 08:07:38 UTC) #6
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 5 months ago (2014-07-11 09:21:07 UTC) #7
commit-bot: I haz the power
Try jobs failed on following builders: android_dbg_triggered_tests on tryserver.chromium (http://build.chromium.org/p/tryserver.chromium/builders/android_dbg_triggered_tests/builds/170025)
6 years, 5 months ago (2014-07-11 09:21:08 UTC) #8
Matt Giuca
Unfortunately, it looks like LOTS of browser tests are failing because they are setting up ...
6 years, 5 months ago (2014-07-16 01:53:35 UTC) #9
not at google - send to devlin
On 2014/07/16 01:53:35, Matt Giuca wrote: > Unfortunately, it looks like LOTS of browser tests ...
6 years, 5 months ago (2014-07-16 16:22:46 UTC) #10
lazyboy
https://chromiumcodereview.appspot.com/371563005/diff/20001/extensions/renderer/dispatcher.cc File extensions/renderer/dispatcher.cc (right): https://chromiumcodereview.appspot.com/371563005/diff/20001/extensions/renderer/dispatcher.cc#newcode271 extensions/renderer/dispatcher.cc:271: DCHECK_EQ(Feature::BLESSED_EXTENSION_CONTEXT, context_type); @kalman, so you're suggesting to add if ...
6 years, 5 months ago (2014-07-21 20:24:50 UTC) #11
not at google - send to devlin
https://chromiumcodereview.appspot.com/371563005/diff/20001/extensions/renderer/dispatcher.cc File extensions/renderer/dispatcher.cc (right): https://chromiumcodereview.appspot.com/371563005/diff/20001/extensions/renderer/dispatcher.cc#newcode271 extensions/renderer/dispatcher.cc:271: DCHECK_EQ(Feature::BLESSED_EXTENSION_CONTEXT, context_type); On 2014/07/21 20:24:50, lazyboy wrote: > @kalman, ...
6 years, 5 months ago (2014-07-21 20:34:09 UTC) #12
lazyboy
6 years, 5 months ago (2014-07-21 22:03:20 UTC) #13
https://chromiumcodereview.appspot.com/371563005/diff/20001/extensions/render...
File extensions/renderer/dispatcher.cc (right):

https://chromiumcodereview.appspot.com/371563005/diff/20001/extensions/render...
extensions/renderer/dispatcher.cc:271:
DCHECK_EQ(Feature::BLESSED_EXTENSION_CONTEXT, context_type);
On 2014/07/21 20:34:09, kalman wrote:
> On 2014/07/21 20:24:50, lazyboy wrote:
> > @kalman, so you're suggesting to add
> > if (!extension->permissions_data()->HasAPIPermission(..kWebView)) to this
> > DCHECK?
> 
> That would work, or a check like isWebviewProcess() if such a thing exists.
The process itself doesn't know much about he webview, but the script executor
has info about this,
ProgrammaticScriptInjector.params_.is_web_view, is that possible to reach to
that from here?
plus
> a check to make sure that it is indeed a content script context being created?
I have e.g. in WebViewTest.Shim_TestChromeExtensionURL, a <webview> that
contains a <script> tag, that's causing context_type to be UNBLESSED_*
guest_with_inline_script.html:
...
<script>window.console.log('...');</script>
https://code.google.com/p/chromium/codesearch#chromium/src/chrome/test/data/e...
So this is not a content script, right?

I wonder why we this script is run on the platform app, or is this expected?

Powered by Google App Engine
This is Rietveld 408576698