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

Side by Side Diff: extensions/renderer/script_context.cc

Issue 1773813007: blink: Rename modules/ method to prefix with get when they collide. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: clash-modules: rebase-fixes Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « extensions/renderer/script_context.h ('k') | extensions/renderer/script_context_set.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "extensions/renderer/script_context.h" 5 #include "extensions/renderer/script_context.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/strings/string_split.h" 10 #include "base/strings/string_split.h"
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 else if (parent->opener() != parent) 285 else if (parent->opener() != parent)
286 parent = parent->opener(); 286 parent = parent->opener();
287 else 287 else
288 parent = nullptr; 288 parent = nullptr;
289 } while (parent && !parent->document().isNull() && 289 } while (parent && !parent->document().isNull() &&
290 GURL(parent->document().url()).SchemeIs(url::kAboutScheme)); 290 GURL(parent->document().url()).SchemeIs(url::kAboutScheme));
291 291
292 if (parent && !parent->document().isNull()) { 292 if (parent && !parent->document().isNull()) {
293 // Only return the parent URL if the frame can access it. 293 // Only return the parent URL if the frame can access it.
294 const blink::WebDocument& parent_document = parent->document(); 294 const blink::WebDocument& parent_document = parent->document();
295 if (frame->document().securityOrigin().canAccess( 295 if (frame->document().getSecurityOrigin().canAccess(
296 parent_document.securityOrigin())) { 296 parent_document.getSecurityOrigin())) {
297 return parent_document.url(); 297 return parent_document.url();
298 } 298 }
299 } 299 }
300 return document_url; 300 return document_url;
301 } 301 }
302 302
303 ScriptContext* ScriptContext::GetContext() { 303 ScriptContext* ScriptContext::GetContext() {
304 DCHECK(thread_checker_.CalledOnValidThread()); 304 DCHECK(thread_checker_.CalledOnValidThread());
305 return this; 305 return this;
306 } 306 }
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
469 v8::Local<v8::Value> argv[]) { 469 v8::Local<v8::Value> argv[]) {
470 return context_->CallFunction(function, argc, argv); 470 return context_->CallFunction(function, argc, argv);
471 } 471 }
472 472
473 gin::ContextHolder* ScriptContext::Runner::GetContextHolder() { 473 gin::ContextHolder* ScriptContext::Runner::GetContextHolder() {
474 v8::HandleScope handle_scope(context_->isolate()); 474 v8::HandleScope handle_scope(context_->isolate());
475 return gin::PerContextData::From(context_->v8_context())->context_holder(); 475 return gin::PerContextData::From(context_->v8_context())->context_holder();
476 } 476 }
477 477
478 } // namespace extensions 478 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/renderer/script_context.h ('k') | extensions/renderer/script_context_set.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698