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

Side by Side Diff: components/nacl/renderer/progress_event.h

Issue 270453004: Pepper: Clean up ProgressEvent logic. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: probable crash fix Created 6 years, 7 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef COMPONENTS_NACL_RENDERER_NEXE_PROGRESS_EVENT_H_
6 #define COMPONENTS_NACL_RENDERER_NEXE_PROGRESS_EVENT_H_
7
8 #include <string>
9
10 #include "ppapi/c/pp_instance.h"
11 #include "ppapi/c/private/ppb_nacl_private.h"
12
13 namespace nacl {
14
15 // See http://www.w3.org/TR/progress-events/ for more details on progress
16 // events.
17 struct ProgressEvent {
18 explicit ProgressEvent(PP_NaClEventType event_type_param)
19 : event_type(event_type_param),
20 length_is_computable(false),
21 loaded_bytes(0),
22 total_bytes(0) {
23 }
24
25 ProgressEvent(PP_NaClEventType event_type_param,
26 const std::string& resource_url_param,
27 bool length_is_computable_param,
28 uint64_t loaded_bytes_param,
29 uint64_t total_bytes_param)
30 : event_type(event_type_param),
31 resource_url(resource_url_param),
32 length_is_computable(length_is_computable_param),
33 loaded_bytes(loaded_bytes_param),
34 total_bytes(total_bytes_param) {
35 }
36
37 PP_NaClEventType event_type;
38 std::string resource_url;
39 bool length_is_computable;
40 uint64_t loaded_bytes;
41 uint64_t total_bytes;
42 };
43
44 // Dispatches a progress event to the DOM frame corresponding to the specified
45 // plugin instance.
46 // This posts a task to the main thread to perform the actual dispatch, since
47 // it's usually intended for progress events to be dispatched after all other
48 // state changes are handled.
49 void DispatchProgressEvent(PP_Instance instance, const ProgressEvent& event);
50
51 } // namespace nacl
52
53 #endif // COMPONENTS_NACL_RENDERER_NEXE_PROGRESS_EVENT_H_
OLDNEW
« no previous file with comments | « components/nacl/renderer/ppb_nacl_private_impl.cc ('k') | components/nacl/renderer/progress_event.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698