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

Side by Side Diff: content/renderer/pepper/v8_var_converter_unittest.cc

Issue 19492014: PPAPI: Purposely leak ProxyLock, fix shutdown race (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove static initializer Created 7 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « content/renderer/pepper/pepper_url_request_unittest.cc ('k') | ppapi/proxy/plugin_globals.h » ('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 (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 "content/renderer/pepper/v8_var_converter.h" 5 #include "content/renderer/pepper/v8_var_converter.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 } 168 }
169 169
170 protected: 170 protected:
171 bool FromV8ValueSync(v8::Handle<v8::Value> val, 171 bool FromV8ValueSync(v8::Handle<v8::Value> val,
172 v8::Handle<v8::Context> context, 172 v8::Handle<v8::Context> context,
173 PP_Var* result) { 173 PP_Var* result) {
174 base::RunLoop loop; 174 base::RunLoop loop;
175 converter_->FromV8Value(val, context, base::Bind( 175 converter_->FromV8Value(val, context, base::Bind(
176 &V8VarConverterTest::FromV8ValueComplete, base::Unretained(this), 176 &V8VarConverterTest::FromV8ValueComplete, base::Unretained(this),
177 loop.QuitClosure())); 177 loop.QuitClosure()));
178 loop.Run();
178 if (conversion_success_) 179 if (conversion_success_)
179 *result = conversion_result_; 180 *result = conversion_result_;
180 return conversion_success_; 181 return conversion_success_;
181 } 182 }
182 183
183 void FromV8ValueComplete(base::Closure quit_closure, 184 void FromV8ValueComplete(base::Closure quit_closure,
184 const ScopedPPVar& scoped_var, 185 const ScopedPPVar& scoped_var,
185 bool success) { 186 bool success) {
186 conversion_success_ = success; 187 conversion_success_ = success;
187 if (success) { 188 if (success) {
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
423 ScopedPPVar oops(ScopedPPVar::PassRef(), StringVar::StringToPPVar("oops")); 424 ScopedPPVar oops(ScopedPPVar::PassRef(), StringVar::StringToPPVar("oops"));
424 expected->SetWithStringKey("undefined", oops.get()); 425 expected->SetWithStringKey("undefined", oops.get());
425 ScopedPPVar release_expected( 426 ScopedPPVar release_expected(
426 ScopedPPVar::PassRef(), expected->GetPPVar()); 427 ScopedPPVar::PassRef(), expected->GetPPVar());
427 428
428 ASSERT_TRUE(TestEqual(release_expected.get(), release_actual.get())); 429 ASSERT_TRUE(TestEqual(release_expected.get(), release_actual.get()));
429 } 430 }
430 } 431 }
431 432
432 } // namespace content 433 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/pepper/pepper_url_request_unittest.cc ('k') | ppapi/proxy/plugin_globals.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698