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

Side by Side Diff: content/renderer/pepper/resource_converter.h

Issue 23330008: Introduce MockResourceConverter to modularize testing of V8VarConverter (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 4 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
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 #ifndef CONTENT_RENDERER_PEPPER_RESOURCE_CONVERTER_H 5 #ifndef CONTENT_RENDERER_PEPPER_RESOURCE_CONVERTER_H
6 #define CONTENT_RENDERER_PEPPER_RESOURCE_CONVERTER_H 6 #define CONTENT_RENDERER_PEPPER_RESOURCE_CONVERTER_H
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
11 #include "base/message_loop/message_loop_proxy.h" 11 #include "content/common/content_export.h"
12 12
13 namespace content { 13 namespace content {
14 14
15 // This class is responsible for converting V8 vars to Pepper resources. 15 // This class is responsible for converting V8 vars to Pepper resources.
16 class ResourceConverter { 16 class CONTENT_EXPORT ResourceConverter {
17 public: 17 public:
18 ResourceConverter(); 18 virtual ~ResourceConverter();
19 ~ResourceConverter(); 19
20 // ShutDown must be called before any vars created by the ResourceConverter 20 // ShutDown must be called before any vars created by the ResourceConverter
21 // are valid. It handles creating any resource hosts that need to be created. 21 // are valid. It handles creating any resource hosts that need to be created.
22 // |message_loop_proxy| is the message loop to run the callback from. 22 virtual void ShutDown(const base::Callback<void(bool)>& callback) = 0;
23 void ShutDown( 23 };
24 const base::Callback<void(bool)>& callback, 24
25 const scoped_refptr<base::MessageLoopProxy>& message_loop_proxy); 25 class ResourceConverterImpl : public ResourceConverter {
26 public:
27 ResourceConverterImpl();
28 virtual ~ResourceConverterImpl();
29 virtual void ShutDown(const base::Callback<void(bool)>& callback) OVERRIDE;
26 30
27 private: 31 private:
28 DISALLOW_COPY_AND_ASSIGN(ResourceConverter); 32 DISALLOW_COPY_AND_ASSIGN(ResourceConverterImpl);
29 }; 33 };
30 34
31 } // namespace content 35 } // namespace content
32 36
33 #endif // CONTENT_RENDERER_PEPPER_RESOURCE_CONVERTER_H 37 #endif // CONTENT_RENDERER_PEPPER_RESOURCE_CONVERTER_H
OLDNEW
« no previous file with comments | « content/renderer/pepper/message_channel.cc ('k') | content/renderer/pepper/resource_converter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698