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

Side by Side Diff: chrome/renderer/extensions/module_system.cc

Issue 63273002: Rename WebKit namespace to blink (part 4) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "chrome/renderer/extensions/module_system.h" 5 #include "chrome/renderer/extensions/module_system.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/debug/trace_event.h" 9 #include "base/debug/trace_event.h"
10 #include "base/stl_util.h" 10 #include "base/stl_util.h"
(...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after
465 v8::Handle<v8::Value> ModuleSystem::RunString(v8::Handle<v8::String> code, 465 v8::Handle<v8::Value> ModuleSystem::RunString(v8::Handle<v8::String> code,
466 v8::Handle<v8::String> name) { 466 v8::Handle<v8::String> name) {
467 v8::HandleScope handle_scope(GetIsolate()); 467 v8::HandleScope handle_scope(GetIsolate());
468 v8::Context::Scope context_scope(context()->v8_context()); 468 v8::Context::Scope context_scope(context()->v8_context());
469 469
470 // Prepend extensions:: to |name| so that internal code can be differentiated 470 // Prepend extensions:: to |name| so that internal code can be differentiated
471 // from external code in stack traces. This has no effect on behaviour. 471 // from external code in stack traces. This has no effect on behaviour.
472 std::string internal_name = base::StringPrintf("extensions::%s", 472 std::string internal_name = base::StringPrintf("extensions::%s",
473 *v8::String::Utf8Value(name)); 473 *v8::String::Utf8Value(name));
474 474
475 WebKit::WebScopedMicrotaskSuppression suppression; 475 blink::WebScopedMicrotaskSuppression suppression;
476 v8::TryCatch try_catch; 476 v8::TryCatch try_catch;
477 try_catch.SetCaptureMessage(true); 477 try_catch.SetCaptureMessage(true);
478 v8::Handle<v8::Script> script(v8::Script::New( 478 v8::Handle<v8::Script> script(v8::Script::New(
479 code, v8::String::New(internal_name.c_str(), internal_name.size()))); 479 code, v8::String::New(internal_name.c_str(), internal_name.size())));
480 if (try_catch.HasCaught()) { 480 if (try_catch.HasCaught()) {
481 HandleException(try_catch); 481 HandleException(try_catch);
482 return v8::Undefined(); 482 return v8::Undefined();
483 } 483 }
484 484
485 v8::Handle<v8::Value> result = script->Run(); 485 v8::Handle<v8::Value> result = script->Run();
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
536 "(function(require, requireNative, exports, " 536 "(function(require, requireNative, exports, "
537 "console, " 537 "console, "
538 "$Array, $Function, $JSON, $Object, $RegExp, $String) {" 538 "$Array, $Function, $JSON, $Object, $RegExp, $String) {"
539 "'use strict';"); 539 "'use strict';");
540 v8::Handle<v8::String> right = v8::String::New("\n})"); 540 v8::Handle<v8::String> right = v8::String::New("\n})");
541 return handle_scope.Close( 541 return handle_scope.Close(
542 v8::String::Concat(left, v8::String::Concat(source, right))); 542 v8::String::Concat(left, v8::String::Concat(source, right)));
543 } 543 }
544 544
545 } // namespace extensions 545 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/renderer/extensions/messaging_bindings.cc ('k') | chrome/renderer/extensions/page_capture_custom_bindings.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698