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

Side by Side Diff: content/shell/renderer/test_runner/test_runner.cc

Issue 1095463003: update chrome to handle temporary WEB_FRAME_USES_V8_LOCAL condition (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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
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 "content/shell/renderer/test_runner/test_runner.h" 5 #include "content/shell/renderer/test_runner/test_runner.h"
6 6
7 #include <limits> 7 #include <limits>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "content/public/test/layouttest_support.h" 10 #include "content/public/test/layouttest_support.h"
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 v8::Isolate* isolate = blink::mainThreadIsolate(); 98 v8::Isolate* isolate = blink::mainThreadIsolate();
99 v8::HandleScope handle_scope(isolate); 99 v8::HandleScope handle_scope(isolate);
100 WebFrame* frame = object_->web_view_->mainFrame(); 100 WebFrame* frame = object_->web_view_->mainFrame();
101 101
102 v8::Handle<v8::Context> context = frame->mainWorldScriptContext(); 102 v8::Handle<v8::Context> context = frame->mainWorldScriptContext();
103 if (context.IsEmpty()) 103 if (context.IsEmpty())
104 return; 104 return;
105 105
106 v8::Context::Scope context_scope(context); 106 v8::Context::Scope context_scope(context);
107 107
108 #ifdef WEB_FRAME_USES_V8_LOCAL
109 scoped_ptr<v8::Local<v8::Value>[]> local_argv;
110 if (argc_) {
111 local_argv.reset(new v8::Local<v8::Value>[argc_]);
112 #else
108 scoped_ptr<v8::Handle<v8::Value>[]> local_argv; 113 scoped_ptr<v8::Handle<v8::Value>[]> local_argv;
109 if (argc_) { 114 if (argc_) {
110 local_argv.reset(new v8::Handle<v8::Value>[argc_]); 115 local_argv.reset(new v8::Handle<v8::Value>[argc_]);
116 #endif
111 for (int i = 0; i < argc_; ++i) 117 for (int i = 0; i < argc_; ++i)
112 local_argv[i] = v8::Local<v8::Value>::New(isolate, argv_[i]); 118 local_argv[i] = v8::Local<v8::Value>::New(isolate, argv_[i]);
113 } 119 }
114 120
115 frame->callFunctionEvenIfScriptDisabled( 121 frame->callFunctionEvenIfScriptDisabled(
116 v8::Local<v8::Function>::New(isolate, callback_), 122 v8::Local<v8::Function>::New(isolate, callback_),
117 context->Global(), 123 context->Global(),
118 argc_, 124 argc_,
119 local_argv.get()); 125 local_argv.get());
120 } 126 }
(...skipping 2914 matching lines...) Expand 10 before | Expand all | Expand 10 after
3035 } 3041 }
3036 3042
3037 void TestRunner::DidLosePointerLockInternal() { 3043 void TestRunner::DidLosePointerLockInternal() {
3038 bool was_locked = pointer_locked_; 3044 bool was_locked = pointer_locked_;
3039 pointer_locked_ = false; 3045 pointer_locked_ = false;
3040 if (was_locked) 3046 if (was_locked)
3041 web_view_->didLosePointerLock(); 3047 web_view_->didLosePointerLock();
3042 } 3048 }
3043 3049
3044 } // namespace content 3050 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698