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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 } | 49 } |
50 | 50 |
51 class MockResourceConverter : public content::ResourceConverter { | 51 class MockResourceConverter : public content::ResourceConverter { |
52 public: | 52 public: |
53 ~MockResourceConverter() override {} | 53 ~MockResourceConverter() override {} |
54 void Reset() override {} | 54 void Reset() override {} |
55 bool NeedsFlush() override { return false; } | 55 bool NeedsFlush() override { return false; } |
56 void Flush(const base::Callback<void(bool)>& callback) override { | 56 void Flush(const base::Callback<void(bool)>& callback) override { |
57 NOTREACHED(); | 57 NOTREACHED(); |
58 } | 58 } |
| 59 void FlushSync() override { NOTREACHED(); } |
59 bool FromV8Value(v8::Handle<v8::Object> val, | 60 bool FromV8Value(v8::Handle<v8::Object> val, |
60 v8::Handle<v8::Context> context, | 61 v8::Handle<v8::Context> context, |
61 PP_Var* result, | 62 PP_Var* result, |
62 bool* was_resource) override { | 63 bool* was_resource) override { |
63 *was_resource = false; | 64 *was_resource = false; |
64 return true; | 65 return true; |
65 } | 66 } |
66 bool ToV8Value(const PP_Var& var, | 67 bool ToV8Value(const PP_Var& var, |
67 v8::Handle<v8::Context> context, | 68 v8::Handle<v8::Context> context, |
68 v8::Handle<v8::Value>* result) override { | 69 v8::Handle<v8::Value>* result) override { |
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
435 expected->SetWithStringKey("null", quux.get()); | 436 expected->SetWithStringKey("null", quux.get()); |
436 ScopedPPVar oops(ScopedPPVar::PassRef(), StringVar::StringToPPVar("oops")); | 437 ScopedPPVar oops(ScopedPPVar::PassRef(), StringVar::StringToPPVar("oops")); |
437 expected->SetWithStringKey("undefined", oops.get()); | 438 expected->SetWithStringKey("undefined", oops.get()); |
438 ScopedPPVar release_expected(ScopedPPVar::PassRef(), expected->GetPPVar()); | 439 ScopedPPVar release_expected(ScopedPPVar::PassRef(), expected->GetPPVar()); |
439 | 440 |
440 ASSERT_TRUE(TestEqual(release_expected.get(), release_actual.get(), true)); | 441 ASSERT_TRUE(TestEqual(release_expected.get(), release_actual.get(), true)); |
441 } | 442 } |
442 } | 443 } |
443 | 444 |
444 } // namespace content | 445 } // namespace content |
OLD | NEW |