OLD | NEW |
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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 namespace content { | 42 namespace content { |
43 | 43 |
44 namespace { | 44 namespace { |
45 | 45 |
46 class MockResourceConverter : public content::ResourceConverter { | 46 class MockResourceConverter : public content::ResourceConverter { |
47 public: | 47 public: |
48 virtual ~MockResourceConverter() {} | 48 virtual ~MockResourceConverter() {} |
49 virtual void Flush(const base::Callback<void(bool)>& callback) OVERRIDE { | 49 virtual void Flush(const base::Callback<void(bool)>& callback) OVERRIDE { |
50 callback.Run(true); | 50 callback.Run(true); |
51 } | 51 } |
| 52 virtual bool FlushSync() OVERRIDE { |
| 53 return true; |
| 54 } |
52 virtual bool FromV8Value(v8::Handle<v8::Object> val, | 55 virtual bool FromV8Value(v8::Handle<v8::Object> val, |
53 v8::Handle<v8::Context> context, | 56 v8::Handle<v8::Context> context, |
54 PP_Var* result, | 57 PP_Var* result, |
55 bool* was_resource) OVERRIDE { | 58 bool* was_resource) OVERRIDE { |
56 *was_resource = false; | 59 *was_resource = false; |
57 return true; | 60 return true; |
58 } | 61 } |
59 virtual bool ToV8Value(const PP_Var& var, | 62 virtual bool ToV8Value(const PP_Var& var, |
60 v8::Handle<v8::Context> context, | 63 v8::Handle<v8::Context> context, |
61 v8::Handle<v8::Value>* result) OVERRIDE { | 64 v8::Handle<v8::Value>* result) OVERRIDE { |
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
442 expected->SetWithStringKey("null", quux.get()); | 445 expected->SetWithStringKey("null", quux.get()); |
443 ScopedPPVar oops(ScopedPPVar::PassRef(), StringVar::StringToPPVar("oops")); | 446 ScopedPPVar oops(ScopedPPVar::PassRef(), StringVar::StringToPPVar("oops")); |
444 expected->SetWithStringKey("undefined", oops.get()); | 447 expected->SetWithStringKey("undefined", oops.get()); |
445 ScopedPPVar release_expected(ScopedPPVar::PassRef(), expected->GetPPVar()); | 448 ScopedPPVar release_expected(ScopedPPVar::PassRef(), expected->GetPPVar()); |
446 | 449 |
447 ASSERT_TRUE(TestEqual(release_expected.get(), release_actual.get(), true)); | 450 ASSERT_TRUE(TestEqual(release_expected.get(), release_actual.get(), true)); |
448 } | 451 } |
449 } | 452 } |
450 | 453 |
451 } // namespace content | 454 } // namespace content |
OLD | NEW |