Skip to content

Commit

Permalink
Add UUID for BaseAudioContext
Browse files Browse the repository at this point in the history
For the future DevTool integration, we need a unique identifier for
each BaseAudioContext. This CL generate a UUID for BaseAudioContext at
its construction time.

Bug: 862411
Change-Id: I2dda45611af21d57820e1539b22091deb8ddf443
Reviewed-on: https://chromium-review.googlesource.com/1132419
Commit-Queue: Hongchan Choi <[email protected]>
Reviewed-by: Raymond Toy <[email protected]>
Cr-Commit-Position: refs/heads/master@{#574204}
  • Loading branch information
hoch authored and Commit Bot committed Jul 11, 2018
1 parent 19ab2ed commit 0f728d0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
#include "third_party/blink/renderer/modules/webaudio/script_processor_node.h"
#include "third_party/blink/renderer/modules/webaudio/stereo_panner_node.h"
#include "third_party/blink/renderer/modules/webaudio/wave_shaper_node.h"
#include "third_party/blink/renderer/platform/uuid.h"
#include "third_party/blink/renderer/platform/audio/iir_filter.h"
#include "third_party/blink/renderer/platform/bindings/exception_state.h"
#include "third_party/blink/renderer/platform/bindings/script_state.h"
Expand All @@ -90,6 +91,7 @@ BaseAudioContext::BaseAudioContext(Document* document,
enum ContextType context_type)
: PausableObject(document),
destination_node_(nullptr),
uuid_(CreateCanonicalUUIDString()),
is_cleared_(false),
is_resolving_resume_promises_(false),
has_posted_cleanup_task_(false),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -351,9 +351,14 @@ class MODULES_EXPORT BaseAudioContext
// Returns the Document wich wich the instance is associated.
Document* GetDocument() const;

const String& Uuid() const { return uuid_; }

private:
friend class AudioContextAutoplayTest;

// Unique ID for each context.
const String uuid_;

bool is_cleared_;
void Clear();

Expand Down

0 comments on commit 0f728d0

Please sign in to comment.